// 文章相关的接口
import axios from '../utils/request' // 引入axios网络请求方法

// 用户已选频道
export const articles = id => axios({
  url: `/v1_0/articles/${id}`
})

// 关注作者接口
export const followings = data => axios({
  url: '/v1_0/user/followings',
  method: 'POST',
  data
})

// 取消关注接口
export const unFollowings = id => axios({
  url: `/v1_0/user/followings/${id}`,
  method: 'DELETE'
})
// /v1_0/article/likings
// 点赞
export const likings = data => axios({
  url: '/v1_0/article/likings',
  method: 'POST',
  data
})
// 取消点赞
export const unLikings = id => axios({
  url: `/v1_0/article/likings/${id}`,
  method: 'DELETE'
})
// 获取评论
export const comments = params => axios({
  url: '/v1_0/comments',
  params
})
// /v1_0/user/followings
// 评论点赞
export const commentLike = data => axios({
  url: '/v1_0/comment/likings',
  method: 'POST',
  data
})
// 评论取消点赞
export const unCommentLike = id => axios({
  url: `/v1_0/comment/likings/${id}`,
  method: 'DELETE'
})
// 评论发布
export const releaseComments = data => axios({
  url: '/v1_0/comments',
  method: 'POST',
  data
})
